package com.qzsoft.zhjd.materiel.modules.materielsupplier.entity;

import java.math.BigDecimal;
import java.util.Date;

import javax.validation.constraints.DecimalMax;
import javax.validation.constraints.NotBlank;

import org.hibernate.validator.constraints.Length;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.qzsoft.jeemis.common.validator.group.AddGroup;
import com.qzsoft.jeemis.common.validator.group.UpdateGroup;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;

/**
 * @ClassName MaterielSupplierEntity
 * @Description 供应商管理
 * @author linhuawei
 * @since 2022-03-30
 */
@Data
@EqualsAndHashCode(callSuper = false)
@NoArgsConstructor
@AllArgsConstructor
@Builder
@ToString
@TableName("n_materiel_supplier")
public class MaterielSupplierEntity {

    /**
     * 主键
     */
    @NotBlank(groups = UpdateGroup.class, message = "供应商标识不能为空")
    @TableId(type = IdType.ASSIGN_UUID)
    private String id;

    /**
     * 基地编码
     */
    @NotBlank(groups = { AddGroup.class, UpdateGroup.class }, message = "所属基地不能为空")
    private String baseCode;

    /**
     * 供应商
     */
    @NotBlank(groups = { AddGroup.class, UpdateGroup.class }, message = "供应商不能为空")
    @Length(groups = { AddGroup.class, UpdateGroup.class }, max = 20, message = "供应商不可超过{max}个字")
    private String name;

    /**
     * 统一社会信用代码
     */
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private String unifiedSocialCreditCode;

    /**
     * 注册资金
     */
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    @DecimalMax(groups = {AddGroup.class, UpdateGroup.class}, value = "9999999.999", message = "注册资金超出最大值")
    private BigDecimal registeredCapital;

    /**
     * 单位性质
     */
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private String unitNature;

    /**
     * 成立日期
     */
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd")
    private Date buildDate;

    /**
     * 资质等级
     */
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private String qualificationLevel;

    /**
     * 纳税人类别
     */
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private String taxpayerCategory;

    /**
     * 评价等级
     */
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private String evaluationGrade;
    
    /**
     * 评价状态
     */
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private String evaluationStatus;

    /**
     * 经营范围
     */
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private String businessScope;

    /**
     * 是否启用
     */
    @TableField(updateStrategy = FieldStrategy.NEVER)
    private Integer enable;

    /**
     * 添加人
     */
    @TableField(fill = FieldFill.INSERT, updateStrategy = FieldStrategy.NEVER)
    private Long creator;

    /**
     * 添加时间
     */
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(fill = FieldFill.INSERT, updateStrategy = FieldStrategy.NEVER)
    private Date createDate;

    /**
     * 修改人
     */
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Long updater;

    /**
     * 修改时间
     */
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date updateDate;

}
